import Immutable from 'immutable';

const defaultState = new Immutable.List();

export default function userSettingReducer(state = defaultState, action) {
  switch(action.type) {
    case 'DELETE_USER_BIND':
      return state.delete(action.id);
    case 'LOAD_USERS':
      console.log("LOAD_USERS", action.data)
      return action.data;

      // if (action.data && action.data.success && action.data.data.length > 0) {
      //   return {
      //     data: action.data.data,
      //     count: action.data.count,
      //     offset: action.data.offset,
      //     limit: action.data.limit
      //   }
      // }else {
      //   return {
      //     data: [],
      //     count: 0,
      //     offset: 0,
      //     limit:20
      //   }
      // }

    case 'UPDATE_EXPIRE_TIME':
      console.log(action);
      return state
    case 'ERROR_USERS_SETTING':
      return action.error.status;
    default:
      return state;
  }
}
